package com.itheima.search.listener;

import com.itheima.swagger.contants.RabbitConstants;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class Load2ESListener {
    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = RabbitConstants.QUEUE_ES),
            exchange = @Exchange(name = RabbitConstants.EXCHANGE_QUESTION,
                    type = ExchangeTypes.TOPIC),
            key = {RabbitConstants.ROUTING_KEY_ES}
    ))
    public void loadQuestionToEs(String questId){
        System.out.println("导入问题到索引库:"+ questId);
    }
}
